#ifndef _PLAYER_H_
#define _PLAYER_H_

#include "cocos2d.h"
#include "Box2D/Box2D.h"


#include <vector>

using namespace cocos2d;

#define PTM_RATIO 32

class CharacterController;
class AnimController;

class Player
{
	enum ANIM_LIST
	{
		ANIM_IDLE = 0,
		ANIM_JUMP,
		ANIM_SPRINT_JUMP,
		ANIM_AIR_DOWN,
		ANIM_BREAK,
		ANIM_WALK,
		ANIM_SPRINT,

		ANIM_COUNT
	};

	CCLabelTTF* Debug;
	b2Body * m_body;
	CharacterController* m_characterController;
    AnimController* m_animController;
	CCSprite* sprite;

	CCAction* mAnimList[ANIM_COUNT];
	void PlayAnim(int ANIM_ID);
	int anim_act;

public:

	Player()
	{
		m_body = NULL;
		m_characterController = NULL;
	}
    virtual ~Player();
    
	void init( CCLayer* layer, b2World* world );
	void update(ccTime dt);
	void updateAnim(ccTime dt);
	virtual void draw( CCPoint Offset = CCPoint(0.0f,0.0f) );

	b2Vec2 getPostion() {return m_body->GetPosition();}
	CCPoint getPixelPosition() { return CCPoint( getPostion().x*PTM_RATIO, getPostion().y*PTM_RATIO); }

	CCNode* getNode() {return sprite;}
};

#endif